package com.jiayang.hhotel.ui;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.jiayang.hhotel.R;
import com.jiayang.hhotel.adapter.AgreeGuestDetailsAdapter;
import com.jiayang.hhotel.bean.AgreeGuestDetailsModel;
import com.jiayang.hhotel.presenter.AgreeGuestDetailsPresenter;
import com.jiayang.hhotel.view.CanNestingListView;

import java.util.List;

import cn.droidlover.xdroidmvp.mvp.XActivity;

/**
 * Created by Administrator on 2017/5/27 0027.
 * 协议客户详情页面
 */

public class AgreeGuestDetailsActivity extends XActivity<AgreeGuestDetailsPresenter> {

    private ImageView pic;
    private TextView synopsis;//简介说明
    private CanNestingListView lv;

    private AgreeGuestDetailsAdapter adapter;

    @Override
    public void initData(Bundle savedInstanceState) {

        initTitle(this,true,getString(R.string.details),R.color.orange_color,null,null);
        pic= (ImageView) findViewById(R.id.iv_pic);
        synopsis= (TextView) findViewById(R.id.tv_synopsis);
        lv= (CanNestingListView) findViewById(R.id.lv);
        getP().asyncLoad(null);
    }

    public void setAdapter(List<AgreeGuestDetailsModel.PTaMainListDtoBean> mList){
        if(adapter==null){
            adapter=new AgreeGuestDetailsAdapter(this,mList);
            lv.setAdapter(adapter);
        }else {
            adapter.notifyDataSetChanged();
        }
    }

    @Override
    public int getLayoutId() {
        return R.layout.layout_agree_guest_details;
    }

    @Override
    public AgreeGuestDetailsPresenter newP() {
        return new AgreeGuestDetailsPresenter();
    }
}
